package com.pms.system.service.impl;

import java.util.List;
import com.pms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pms.system.mapper.PmsGuestroomItemMapper;
import com.pms.system.domain.PmsGuestroomItem;
import com.pms.system.service.IPmsGuestroomItemService;

/**
 * 客房类型Service业务层处理
 * 
 * @author 达瓦里氏
 * @date 2023-03-04
 */
@Service
public class PmsGuestroomItemServiceImpl implements IPmsGuestroomItemService 
{
    @Autowired
    private PmsGuestroomItemMapper pmsGuestroomItemMapper;

    /**
     * 查询客房类型
     * 
     * @param id 客房类型主键
     * @return 客房类型
     */
    @Override
    public PmsGuestroomItem selectPmsGuestroomItemById(Long id)
    {
        return pmsGuestroomItemMapper.selectPmsGuestroomItemById(id);
    }

    /**
     * 查询客房类型列表
     * 
     * @param pmsGuestroomItem 客房类型
     * @return 客房类型
     */
    @Override
    public List<PmsGuestroomItem> selectPmsGuestroomItemList(PmsGuestroomItem pmsGuestroomItem)
    {
        return pmsGuestroomItemMapper.selectPmsGuestroomItemList(pmsGuestroomItem);
    }

    /**
     * 新增客房类型
     * 
     * @param pmsGuestroomItem 客房类型
     * @return 结果
     */
    @Override
    public int insertPmsGuestroomItem(PmsGuestroomItem pmsGuestroomItem)
    {
        pmsGuestroomItem.setCreateTime(DateUtils.getNowDate());
        return pmsGuestroomItemMapper.insertPmsGuestroomItem(pmsGuestroomItem);
    }

    /**
     * 修改客房类型
     * 
     * @param pmsGuestroomItem 客房类型
     * @return 结果
     */
    @Override
    public int updatePmsGuestroomItem(PmsGuestroomItem pmsGuestroomItem)
    {
        pmsGuestroomItem.setUpdateTime(DateUtils.getNowDate());
        return pmsGuestroomItemMapper.updatePmsGuestroomItem(pmsGuestroomItem);
    }

    /**
     * 批量删除客房类型
     * 
     * @param ids 需要删除的客房类型主键
     * @return 结果
     */
    @Override
    public int deletePmsGuestroomItemByIds(Long[] ids)
    {
        return pmsGuestroomItemMapper.deletePmsGuestroomItemByIds(ids);
    }

    /**
     * 删除客房类型信息
     * 
     * @param id 客房类型主键
     * @return 结果
     */
    @Override
    public int deletePmsGuestroomItemById(Long id)
    {
        return pmsGuestroomItemMapper.deletePmsGuestroomItemById(id);
    }
}
